package com.hy.main.api;

import java.math.BigDecimal;
import java.util.Optional;

public class Test {
    public static void main(String[] args) {
        // 模拟你的源数据
        BigDecimal sourceData = new BigDecimal("570000");

        System.out.println("原始数据: " + sourceData);
        System.out.println("stripTrailingZeros(): " + sourceData.stripTrailingZeros());
        System.out.println("最终结果: " + sourceData.stripTrailingZeros().toPlainString());

        // 完整模拟你的代码
        Optional.ofNullable(sourceData).ifPresent(resultingFactoryMileage -> {
            String finalResult = resultingFactoryMileage.stripTrailingZeros().toString();
            System.out.println("代码执行结果: " + finalResult);
        });
    }
}